//
//  AppDelegate.m
//  Codex
//
//  Created by ChenJie on 2/14/20.
//  Copyright © 2020 Mist. All rights reserved.
//

#import "AppDelegate.h"
#import "OASDK.h"
#import "CDXRootViewController.h"
#import "OADLayout5ViewController.h"

@interface AppDelegate ()

@property (nonatomic, strong) UIViewController *rootVc;

@end

@implementation AppDelegate

#pragma mark - Lifecycle methods

#define eps 1e-7

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    //
    [self buildRootVc];
    
//    NSString *v1 = @"63000";
//    NSString *v2 = @"90000";
//    
//    CGFloat float1 = [v1 floatValue];
//    CGFloat float2 = [v2 floatValue] * 0.7;
//    
//    NSLog(@"f1: %f", float1);
//    NSLog(@"f2: %f", float2);
//    
//    if (float1 > float2 + eps) {
//        NSLog(@">>>>>>>");
//    } else {
//        NSLog(@"-------");
//    }
    
    
    return YES;
}

#pragma mark - Public methods



#pragma mark - Private methods

- (void)buildRootVc {
    self.window.rootViewController = self.rootVc;
    [self.window makeKeyAndVisible];
}

#pragma mark - Getter

- (UIWindow *)window {
    if (!_window) {
        UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _window = window;
    }
    return _window;
}

- (UIViewController *)rootVc {
    if (!_rootVc) {
//        OADLayout5ViewController *vc = [[OADLayout5ViewController alloc] init];
        CDXRootViewController *vc = [[CDXRootViewController alloc] init];
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
        
        _rootVc = nav;
    }
    return _rootVc;
}

@end
